#!/bin/bash

function print_x_axis(){  
    local Line= Title= Bytes= Xlength=  
  
    Title="$*"  
    Line='-'  
  
    if [ -n "${Title}" ]; then  
        Bytes=$(echo "${Title}"|wc -c)  
    else  
        Bytes=1  
    fi  
  
    Xlength=$(( $(stty size|awk '{print $2}') - ${Bytes} ))  
    printf '%s ' "${Title}"  
    printf "%${Xlength}s\n" "${Line}"|sed "s/ /${Line}/g"  
}  